package com.qyhl.webtv.module_live.teletext.chatroom;


import com.avos.avoscloud.im.v2.AVIMClient;
import com.avos.avoscloud.im.v2.AVIMConversation;
import com.avos.avoscloud.im.v2.AVIMTypedMessage;
import com.avos.avoscloud.im.v2.AVIMTypedMessageHandler;
import com.avos.avoscloud.im.v2.messages.AVIMAudioMessage;
import com.avos.avoscloud.im.v2.messages.AVIMFileMessage;
import com.avos.avoscloud.im.v2.messages.AVIMImageMessage;
import com.avos.avoscloud.im.v2.messages.AVIMLocationMessage;
import com.avos.avoscloud.im.v2.messages.AVIMVideoMessage;
import com.qyhl.webtv.commonlib.utils.eventbus.BusFactory;
import com.qyhl.webtv.module_live.utils.Event;

/**
 * Created by jizhou on 2017/7/31.
 */

public class TeleTextMessageHandler extends AVIMTypedMessageHandler<AVIMTypedMessage> {

    public TeleTextMessageHandler() {

    }

    @Override
    public void onMessage(AVIMTypedMessage message, AVIMConversation conversation, AVIMClient client) {
        switch (message.getMessageType()) {
            case -1:
                BusFactory.getBus().postSticky(new Event.TeleTextEventMessage(message));
                break;
            case -2:
                AVIMImageMessage imageMsg = (AVIMImageMessage) message;

                break;

            case -3:
                AVIMAudioMessage audioMsg = (AVIMAudioMessage) message;

                break;

            case -4:
                AVIMVideoMessage videoMsg = (AVIMVideoMessage) message;

                break;

            case -5:
                AVIMLocationMessage locMsg = (AVIMLocationMessage) message;

                break;

            case -6:
                AVIMFileMessage fileMsg = (AVIMFileMessage) message;

                break;
            default:
                break;
        }

    }

    @Override
    public void onMessageReceipt(AVIMTypedMessage message, AVIMConversation conversation, AVIMClient client) {
        // 请加入你自己需要的逻辑...
    }

}
